package com.qf.service.impl;/*
 *保护你的大熊
 *2021/11/29
 *22:48
 */

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsOrderGoodsMapper;
import com.qf.pojo.DtsOrderGoods;
import com.qf.service.DtsGoodsOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DtsGoodsOrderServiceImpl implements DtsGoodsOrderService {

    @Autowired
    DtsOrderGoodsMapper orderGoodsMapper;

    @Override
    public int findCountByGid(Integer id) {

        LambdaQueryWrapper<DtsOrderGoods> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsOrderGoods::getDeleted,false);
        wrapper.eq(DtsOrderGoods::getGoodsId,id);

        return orderGoodsMapper.selectCount(wrapper);

    }

}
